﻿<UserControl x:Class="Microsoft.Research.DynamicDataDisplay.Samples.Internals.Views.ReleaseView"
			 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
			 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
			 xmlns:m="clr-namespace:Microsoft.Research.DynamicDataDisplay.Samples.Internals.Models"
			 xmlns:v="clr-namespace:Microsoft.Research.DynamicDataDisplay.Samples.Internals.Views"
			 v:ViewService.SelectedValue="{Binding ElementName=list, Path=SelectedValue}"
			 >
	<ListView ItemsSource="{Binding}" Name="list" SelectionMode="Single">
		<ListView.ItemsPanel>
			<ItemsPanelTemplate>
				<WrapPanel/>
			</ItemsPanelTemplate>
		</ListView.ItemsPanel>

		<ListView.ItemContainerStyle>
			<Style TargetType="{x:Type ListViewItem}">
				<Setter Property="ContentTemplate">
					<Setter.Value>
						<DataTemplate DataType="{x:Type m:Demonstration}">
							<Grid Margin="5" MinWidth="200" MinHeight="200">
								<Grid.Style>
									<Style TargetType="Grid">
										<Style.Triggers>
											<Trigger Property="ListViewItem.IsSelected" Value="True">
												<Setter Property="Background" Value="Blue"/>
											</Trigger>
										</Style.Triggers>
									</Style>
								</Grid.Style>

								<Grid>
									<Grid.RowDefinitions>
										<RowDefinition Height="*"/>
										<RowDefinition Height="Auto"/>
									</Grid.RowDefinitions>
									
									<v:DemonstrationView DataContext="{Binding Uri}"/>
									<TextBlock Margin="0,3,0,0" Text="{Binding Description}" HorizontalAlignment="Center" Grid.Row="1"/>
								</Grid>
								<Rectangle Stroke="DarkGray" RadiusX="3" RadiusY="3" StrokeThickness="1" Margin="-2,-2,-2,0"/>

							</Grid>
						</DataTemplate>
					</Setter.Value>
				</Setter>
			</Style>
		</ListView.ItemContainerStyle>
	</ListView>
</UserControl>
